<template>
  <div>
    <span>仓库的age：{{userStoreData.age}}</span>
    <span>仓库的username：{{userStoreData.username}}</span>
    <span>仓库的role：{{userStoreData.role}}</span>
    <el-button @click="changeStoreAge">仓库的age修改</el-button>
    <el-button @click="changeStoreDataAsync">异步修改</el-button>
    <span>{{userStoreData.fullName}}</span>
  </div>
</template>

<script lang='ts' setup>
//组合API
import {userStore} from "@/store/userStore"
const userStoreData = userStore()
console.log(userStoreData);
console.log(userStoreData.age);
console.log(userStoreData.username);

const changeStoreAge = ()=>{
  userStoreData.increment(44)
}

const changeStoreDataAsync = ()=>{
  userStoreData.increment2()
}
</script>

<style lang='scss' scoped>
</style>